草庐IT

Linux PID 回收

全部标签

android - 如何将数据从回收器适配器发送到 fragment |如何从 recyclerview 适配器调用 fragment 函数

我在Fragment中有代码:InfoAdapteradapter=newInfoAdapter(getContext(),R.layout.lv_info,infoList);listingsView=(RecyclerView)rootView.findViewById(R.id.lvInfo);RecyclerView.LayoutManagerlayoutManager=newLinearLayoutManager(getContext());listingsView.setLayoutManager(layoutManager);listingsView.setHasFixe

android - 我是否需要回收 BitmapDrawable

根据http://developer.android.com/training/displaying-bitmaps/manage-memory.htmlOnAndroid2.3.3(APIlevel10)andlower,usingrecycle()isrecommended.Ifyou'redisplayinglargeamountsofbitmapdatainyourapp,you'relikelytorunintoOutOfMemoryErrorerrors.Therecycle()methodallowsanapptoreclaimmemoryassoonaspossible

java - Espresso 嵌套回收器 View UI 测试

我在垂直RecyclerView中有一个水平RecyclerView。我正在使用我在其他问题上找到的这段代码:onView(allOf(isDescendantOfA(withRecyclerView(R.id.parentVerticalRecyclerView).atPosition(parentPosition)),isDescendantOfA(withRecyclerView(R.id.childHorizontalRecyclerView).atPosition(childPosition)),(withText("USA")))).perform(click());//I

android - 如何在 android 中位置 2 的回收站 View 中添加广告?

我有一个回收站View,我在其中使用rss阅读器获取新闻提要,在回收站View的索引2处,我想放置一个广告View,但不知道如何放置。请立即为我提供有关此问题的解决方案。回收站View的代码:-privateContextmContext;privateViewmain;privateRecyclerViewm_newsList;privateRecyclerView.LayoutManagerm_layoutManager;privateCNewsAdapterm_newsAdapter;Stringtagname;ArrayListfeeds=newArrayList();priv

android - 如何使用回收者 View 在两侧发送和接收消息进行线程化消息 View

我正在使用Firebase制作一个聊天应用程序,基本上该应用程序运行良好。我在UI上工作,有一个问题,消息接收者或发件人是RecyclerView的一侧,我想要它的两边(右边是发件人,左边是收件人)我有2个XML文件用于消息收件人和发件人已经如此,我如何将item_message_input.xml用于发件人和item_message.xml用于收件人(抱歉,我不知道如何清楚地描述我的问题)。这是我的代码:主Activity.javapublicclassMainActivityextendsAppCompatActivityimplementsGoogleApiClient.OnCo

java - Surface在Android上被parceled后如何处理垃圾回收?

我正在使用sourcecodeforSurface.java作为这个问题的引用。Surface实现了Parcelable接口(interface),并且它还持有native端对象的句柄。我很想知道在这种情况下如何处理垃圾回收:Surface(A)创建并写入Parcel。之后再无提及。从Parcel中读取原始Surface(B)的副本;假设这发生在另一个用于渲染的线程上。这个实例现在拥有与(A)相同的native句柄,并且在某处有对该实例的强引用。发生GC并收集(A),因为它不再被引用。finalize()运行,它调用release(),后者又为native句柄调用nativeRelea

android - 回收站 View 项目输入动画不起作用

我遵循了动画recyclerview项目的教程,但动画不工作我很困惑是否应用了动画。Activity.Java:更新的代码在这里我尝试单击按钮但我不知道如何从适配器的onBindHolder调用动画方法privatevoidsetupRecyclerView(){RecyclerView.LayoutManagermLayoutManager=newLinearLayoutManager(getApplicationContext());recyclerView.setLayoutManager(mLayoutManager);finalLayoutAnimationControlle

android - 回收位图

我正在从事涉及位图操作的项目。因为我不想有OutofMemoryError我试图回收每个未使用的位图。不幸的是,我回收了太多,并出现“尝试使用回收的位图”错误。我正在使用:Bitmap.createBitmap(bmp,x,y,w,h,matrix,false);Bitmap.createScaledBitmap(bmp,w,h,true);我应该在这些方法之后回收bmp还是由它们回收?喜欢:BitmapnewBitmap=Bitmap.createBitmap(bmp,x,y,w,h,matrix,false);bmp.recycle();我可以在imageView.setImage

android - 缩放中央图像回收器 View

我有带有图像的RecyclerView。它基于thissolution.使用Glide将图像延迟加载到View中。我需要像这样在中央图像上添加缩放:我该怎么做? 最佳答案 影响你想要什么的最直接的方法是扩展LinearLayoutManager。正如您无疑发现的那样,正确地Hook到滚动事件是一件痛苦的事情:那么让我们扩展管理器。我们将创建一些您可能会公开的参数。publicclassZoomCenterCardLayoutManagerextendsLinearLayoutManager{//Shrinkthecardsaroun

android - 回收站 View 中的动态 View 问题

我正在使用回收站View来显示包含图像网格布局的项目列表。网格布局动态添加到回收器View适配器上“onBindViewHolder”方法内的列表项。现在的问题是在每次滚动时都会重新创建网格布局View。我不希望在滚动时重新创建这些View。怎么处理??这是代码fragment@OverridepublicvoidonBindViewHolder(finalPersonViewHolderpersonViewHolder,finalinti){GridLayoutfeedGrid=newGridLayout(context);LinearLayout.LayoutParamslayou